package com.example.curvedemo.widget

/**
 * @Description 新版趋势图数据
 * @Author whh
 */
class CurveNewData {

    /** 类型名称  */
    var name: String? = ""

    /**
     * 类型数据列表
     */
    var data: ItemData? = ItemData()

    /**
     * 权限
     */
    var authority: Int = 0

    /**
     * 趋势图子项数据
     */
    class ItemData {
        /** x轴坐标数据  */
        var xDataList: ArrayList<XData>? = ArrayList()

        /** 趋势图线数据   */
        var lineDataList: ArrayList<LineData>? = ArrayList()

        /** 趋势图提示数据  */
        var lineTopDataList: ArrayList<LineData>? = ArrayList()

        /** 柱状图数据   */
        var columnDataList: ArrayList<LineData>? = ArrayList()

        /** Y轴坐标数  */
        var numY: Int = 0
    }

    /**
     * 线数据模型
     */
    class LineData {
        var title: String? = ""

        /**
         * 每格高度对应的值
         */
        var verticalAnnualValueY: Long = 0
        var verticalValueY_min: Long = 0
        var multiple: Int = 1
        var isPercentage: Boolean = false
        var zero_num: Int = 0
        var data: List<ItemData>? = java.util.ArrayList()

        constructor(title: String, data: List<ItemData>) {
            this.title = title
            this.data = data
        }

        constructor(title: String, data: List<ItemData>, multiple: Int) {
            this.title = title
            this.data = data
            this.multiple = multiple
        }

        constructor(title: String, data: List<ItemData>, multiple: Int, isPercentage: Boolean) {
            this.title = title
            this.data = data
            this.multiple = multiple
            this.isPercentage = isPercentage
        }

        /**
         * 点数据数据
         */
        class ItemData {
            /**
             * 值（整形）
             */
            var value: Long = 0

            /**
             * 值（字符串）
             */
            var valueStr: String? = ""

            /**
             * 提示（用于展示在选中框值得后面）
             */
            var dataTip: String? = ""

            constructor(value: Long, valueStr: String?) {
                this.value = value
                this.valueStr = valueStr
            }

            constructor(value: Long, valueStr: String?, dataTip: String?) {
                this.value = value
                this.valueStr = valueStr
                this.dataTip = dataTip
            }
        }
    }

    /**
     * x轴数据模型
     */
    class XData(var title: String, var titleStr: String?)
}